#ifndef ITEXT_H
#define ITEXT_H
#pragma pack(push,1)

#include "../assetfilemgr.h"
#include "../formats/textformat.h"

class IText : public STextData
{
public:
	static void	*AssetInit( IAssetFile *pFile, const CMasterIndexEntry *pEntry, void *context );
	static void	AssetUninit( void *ptr, void *context );
	static void	AssetFixup( CAssetFileMgr *pMgr, const IAssetFile *pFile, void *ptr, const CMasterIndexEntry *pEntry );

	static void	Register( CAssetFileMgr *pMgr )
	{
		pMgr->AddAssetType("TEXT",AssetInit,AssetUninit,AssetFixup);
	}

public:

	const unicode	*GetText( const char *key ) const
	{
		return GetText(MakeStringHash(key));
	}
	const unicode	*GetText( HASH key ) const
	{
		return (const unicode*)dictionary.FindByHash(key);
	}
};

#pragma pack(pop)
#endif
